package com.dys.ai.entity;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 车厢表实体类
 */
public class Carriage implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键（自增）
     */
    private Long id;

    /**
     * 所属列车ID（外键）
     */
    private Long trainId;

    /**
     * 车厢号（如：1、2）
     */
    private Integer carriageNumber;

    /**
     * 车厢类型（0:商务座,1:一等座,2:二等座,3:餐车）
     */
    private Integer carriageType;

    /**
     * 该车厢总座位数
     */
    private Integer totalSeats;

    /**
     * 座位布局（如："2+1"）
     */
    private String layout;

    /**
     * 创建时间（自动填充）
     */
    private LocalDateTime createTime;

    /**
     * 更新时间（自动填充）
     */
    private LocalDateTime updateTime;

    public Carriage() {
    }

    public Carriage(Long id, Long trainId, Integer carriageNumber, Integer carriageType, Integer totalSeats, String layout, LocalDateTime createTime, LocalDateTime updateTime) {
        this.id = id;
        this.trainId = trainId;
        this.carriageNumber = carriageNumber;
        this.carriageType = carriageType;
        this.totalSeats = totalSeats;
        this.layout = layout;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getTrainId() {
        return trainId;
    }

    public void setTrainId(Long trainId) {
        this.trainId = trainId;
    }

    public Integer getCarriageNumber() {
        return carriageNumber;
    }

    public void setCarriageNumber(Integer carriageNumber) {
        this.carriageNumber = carriageNumber;
    }

    public Integer getCarriageType() {
        return carriageType;
    }

    public void setCarriageType(Integer carriageType) {
        this.carriageType = carriageType;
    }

    public Integer getTotalSeats() {
        return totalSeats;
    }

    public void setTotalSeats(Integer totalSeats) {
        this.totalSeats = totalSeats;
    }

    public String getLayout() {
        return layout;
    }

    public void setLayout(String layout) {
        this.layout = layout;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Carriage{" +
                "id=" + id +
                ", trainId=" + trainId +
                ", carriageNumber=" + carriageNumber +
                ", carriageType=" + carriageType +
                ", totalSeats=" + totalSeats +
                ", layout='" + layout + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
